﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace IRepository.Migrations
{
    public partial class _4 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "T_MemberLevels",
                columns: table => new
                {
                    MemberLevel_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LevelName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MemberLevels", x => x.MemberLevel_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_MemberRoles",
                columns: table => new
                {
                    MemberRole_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Role_Id = table.Column<int>(type: "int", nullable: false),
                    MemberRole_IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MemberRoles", x => x.MemberRole_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Members",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Member_Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    Member_Pwd = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    Tel_Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Member_Card = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BirthDay = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Score = table.Column<int>(type: "int", nullable: false),
                    Money = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    MemberLevel_Id = table.Column<int>(type: "int", nullable: false),
                    Gender = table.Column<int>(type: "int", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    State = table.Column<bool>(type: "bit", nullable: false),
                    Member_ErrorCount = table.Column<int>(type: "int", nullable: false),
                    Member_IsIock = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Members", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Roles",
                columns: table => new
                {
                    Role_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Role_Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
                    Role_State = table.Column<bool>(type: "bit", nullable: false),
                    Role_IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Roles", x => x.Role_Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_MemberLevels");

            migrationBuilder.DropTable(
                name: "T_MemberRoles");

            migrationBuilder.DropTable(
                name: "T_Members");

            migrationBuilder.DropTable(
                name: "T_Roles");
        }
    }
}
